1 #PROGRAM-ID ChargeInEMfield
3 # A mass m with charge q>0 is located in a static electro-magnetic field [0,0,E], [0,-B,0].
5 # Differential equation (Lorentz force):
7 # z'' = a*omega^2 - omega*x'
8 # good start settings are omega=0,92, a*omega^2=0,05
10 # coefficient definition
11 alias coefficient.1 -> omega_x # -omega for x'
12 coefficient.2 (+1) -> a*omega^2
13 alias coefficient(3) -> omega_z # omega for z'
16 iintegrate (x'') -> -x'
19 coefficient.omega_x (-x') -> -omega*x'
20 #cmultiply (-x', omega_x) -> omega*x'
22 iintegrate (a*omega^2, -omega*x') -> -z' # input is z''
26 coefficient.omega_z (z') -> omega*z'
27 #cmultiply (z', omega_z) -> omega*z'
28 assign omega*z' -> x''